<div id="sidebar" >
  <ul>
  <?php if(isset($menu['list']))foreach ($menu['list'] as $items){
    ?>
    <li  class="<?php if($items['checked']==1) { ?>submenu  open active<?php }else{ ?> submenu<?php } ?>"  ><a href="#">
    	<i    class="<?php if($items['checked']==1) { ?>icon icon-th-list<?php }else{ ?>icon icon-home<?php } ?>"></i> 
     <span   class="<?php if($items['checked']==1) { ?><?php }else{ ?>icon<?php } ?>">
     <?php if($items['checked']==1){?><strong><?php }?>
     <?php echo $items['access_name']?>
     <?php if($items['checked']==1){?></strong><?php }?>
     <?php  if($items['checked']!=1){ ?><span class="fr" style="margin-right: 22px;"></span><?php }?>
     </span>
     </a>
        <ul  style="<?php if($items['checked']==1) { ?>display:block<?php }else{ ?>display:none<?php } ?>" >
			  <?php if(!empty($items['detail']))
			    foreach ($items['detail'] as $f){
		    	?>
		    		<li  class="<?php if($f['checked']==1) { ?>active<?php } ?>" ><a href="<?php echo $f['access_url'];?><?php echo (strpos($f['access_url'],'?')===false)?'?':'&'?>sid=<?php echo $f['sid'];?>" <?php echo ($f['target']==1)?"target='_blank'":"";?>>&nbsp;<?php echo $f['access_name']?></a></li>
		    	<?php 
			    }
			?>   
	   </ul>
     </li>
    <?php 
  }?>
  </ul>
</div>
